package object;

import java.util.Date;
import java.util.GregorianCalendar;
import java.lang.Object;


public class Employee {

  private String name;
  private double salary;
  private Date hireDay;


  public Employee(String name, double salary, int year, int month, int day) {
    this.name = name;
    this.salary = salary;
    GregorianCalendar calendar = new GregorianCalendar(year, month - 1, day);
    this.hireDay = calendar.getTime();
  }


  public String getName() {
    return this.name;
  }


  public double getSalary() {
    return this.salary;
  }


  public Date getHireDay() {
    return this.hireDay;
  }


  public void raiseSalary(double percent) {
    this.salary *= (1 + percent / 100);
  }


  public boolean equals(Object otherObject) {
    if (this == otherObject)
      return true;
    if (otherObject == null)
      return false;
    if (getClass() != otherObject.getClass())
      return false;
    Employee other = (Employee) otherObject;
    return this.name.equals(other.name)
      && this.salary == other.salary
      && this.hireDay.equals(other.hireDay);
  }


  public static void main(String[] args) {
      Employee e = new Employee("hello kitty", 2.34, 2013, 10, 1);
      System.out.println(e.getClass());
  }

}
